package com.iwhalecloud.bss.kite.cucc.listener.prod.local;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import com.iwhalecloud.bss.kite.cucc.listener.handler.LocalProdInstFuncHandler;
import com.iwhalecloud.bss.kite.event.prod.RemoveProdFuncEvent;

/**
 * 删除功能产品事件监听器
 * @author su.yongmin
 * @date 2019年6月10日
 * @desc
 */

@Component
public class LocalRemoveProdFuncListener {

    @Autowired
    private LocalProdInstFuncHandler prodInstFuncHandler;

    //删除功能产品时，联动处理其他产品属性个性处理
    @EventListener
    @Order(4)
    @Async
    public void delLinkedDataDeal(RemoveProdFuncEvent event) {
        String funcProdInstId = event.getFuncProdInstId();
        String prodInstId = event.getProdInstId();

        String sceneInstId = event.getSceneInstId();
        String custId = event.getCustId();
        prodInstFuncHandler.removeProdInstFuncAttrDeal(sceneInstId, funcProdInstId, prodInstId, custId);

    }
}
